<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <script type="text/javascript">
	console.log("==========参数=============");
	function f1(x) {
	return x * x;
	}

	console.log(f1(2));
	console.log(f1(3));

	function f2(a,b) {
	}
	f2('a','b','c')
	console.log(f2.length);

    console.log("============传递方式===========");
	var a = 2;
	function f3(a) {
	a = 3;
	return a;
	}

	console.log(f3(a)+' '+ a);

	console.log("============传递方式--传址传递===========");
	var obj = {
	name
	};

	function f4(o) {
	o.name = 2;
	o.age = 18;

	}
	f4(obj);

	console.log(obj.name);


	console.log("============传递方式--传址传递===========");


	var arr = [1,2,3];
	function f5(b) {
	b = [2,3,4];
	}

	f5(arr);

	console.log(arr);


	console.log("============同名参数===========");
    function f6(a,a) {
	return a;
	}

	console.log(f6(2,3));


	console.log("============arguments对象===========");

	var num = function (a,b,c) {

	console.log(arguments[0]);
	console.log(arguments[1]);
	console.log(arguments[2]);
    }


	num(1,2,3);


	console.log("============闭包===========");

	function f7() {
	var n = 99;
	function f8(n) {
	console.log(n);
	}
	return f8(n);
	}

	f7();
	</script>
</body>
</html>
